<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ChatGPT</title>
<!--  标签页图标显示-->
    <link rel="shortcut icon" href="/static/favicon-32x32.png" type="image/x-icon">
    <link rel="stylesheet" href="/static/css/common.css">

    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/marked.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML"></script>
    <script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/a11y-dark.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/highlight.min.js"></script>
    <!-- and it's easy to individually load additional languages -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/languages/go.min.js"></script>

</head>
<script src="/static/js/settings.js"></script>
<body>
    <div class="all-container">

        <div id="settings-dialog">
            <div class="settings-close-btn" onclick="toggle_settings_dialog()">
                <svg class="svg-icon" viewBox="0 0 20 20">
                    <path fill="none" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
                </svg>
            </div>
            <div class="setting-menus">
                <div class="setting-menu">
                    <div class="setting-label" style="font-size: 30px">
                        设置
                    </div>
                    <div class="setting">
                        <div class="setting-label">
                            <div>用户ID</div>
                            <div class="setting-sub-label">
                                用于绑定你的云端聊天记录
                            </div>
                        </div>
                        <input type="text" id="user-id" name="user_id">
                    </div>
                    <div class="setting">
                        <div class="setting-label">
                            <div>密码</div>
                            <div class="setting-sub-label">
                                访问密码，后台若需要则需要输入
                            </div>
                        </div>
                        <input type="password" id="password" name="password">
                    </div>
                    <div class="setting">
                        <div class="setting-label">
                            <div>API Key</div>
                            <div class="setting-sub-label">
                                当输入API Key后,可跳过访问密码
                            </div>
                        </div>
                        <input type="text" id="api-key" name="api_key">
                    </div>
                    <div class="setting">
                        <div class="label-svg-button">
                            <div class="setting-label">
                                <div>下载用户记录</div>
                                <div class="setting-sub-label">
                                    下载个人用户记录或所有用户记录
                                </div>
                            </div>
                            <div id="userDictFileDownload">
                                <svg class="svg-icon" viewBox="0 0 20 20">
                                    <path fill="none" d="M15.608,6.262h-2.338v0.935h2.338c0.516,0,0.934,0.418,0.934,0.935v8.879c0,0.517-0.418,0.935-0.934,0.935H4.392c-0.516,0-0.935-0.418-0.935-0.935V8.131c0-0.516,0.419-0.935,0.935-0.935h2.336V6.262H4.392c-1.032,0-1.869,0.837-1.869,1.869v8.879c0,1.031,0.837,1.869,1.869,1.869h11.216c1.031,0,1.869-0.838,1.869-1.869V8.131C17.478,7.099,16.64,6.262,15.608,6.262z M9.513,11.973c0.017,0.082,0.047,0.162,0.109,0.226c0.104,0.106,0.243,0.143,0.378,0.126c0.135,0.017,0.274-0.02,0.377-0.126c0.064-0.065,0.097-0.147,0.115-0.231l1.708-1.751c0.178-0.183,0.178-0.479,0-0.662c-0.178-0.182-0.467-0.182-0.645,0l-1.101,1.129V1.588c0-0.258-0.204-0.467-0.456-0.467c-0.252,0-0.456,0.209-0.456,0.467v9.094L8.443,9.553c-0.178-0.182-0.467-0.182-0.645,0c-0.178,0.184-0.178,0.479,0,0.662L9.513,11.973z"></path>
                                </svg>
                            </div>
                        </div>
                        <div class="label-svg-button">
                            <div class="setting-label">
                                <div>上传并合并用户记录</div>
                                <div class="setting-sub-label">
                                    上传并合并个人用户记录或所有用户记录
                                </div>
                            </div>
                            <div>
                                <label for="userDictFileUpload">
                                    <svg class="svg-icon" viewBox="0 0 20 20">
                                        <path fill="none" d="M8.416,3.943l1.12-1.12v9.031c0,0.257,0.208,0.464,0.464,0.464c0.256,0,0.464-0.207,0.464-0.464V2.823l1.12,1.12c0.182,0.182,0.476,0.182,0.656,0c0.182-0.181,0.182-0.475,0-0.656l-1.744-1.745c-0.018-0.081-0.048-0.16-0.112-0.224C10.279,1.214,10.137,1.177,10,1.194c-0.137-0.017-0.279,0.02-0.384,0.125C9.551,1.384,9.518,1.465,9.499,1.548L7.76,3.288c-0.182,0.181-0.182,0.475,0,0.656C7.941,4.125,8.234,4.125,8.416,3.943z M15.569,6.286h-2.32v0.928h2.32c0.512,0,0.928,0.416,0.928,0.928v8.817c0,0.513-0.416,0.929-0.928,0.929H4.432c-0.513,0-0.928-0.416-0.928-0.929V8.142c0-0.513,0.416-0.928,0.928-0.928h2.32V6.286h-2.32c-1.025,0-1.856,0.831-1.856,1.856v8.817c0,1.025,0.832,1.856,1.856,1.856h11.138c1.024,0,1.855-0.831,1.855-1.856V8.142C17.425,7.117,16.594,6.286,15.569,6.286z"></path>
                                    </svg>
                                </label>
                                <input type="file" id="userDictFileUpload" style="display:none;">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="chat-setting-dialog" style="display: none;">
            <div class="settings-close-btn" onclick="toggle_chat_setting_dialog()">
                <svg class="svg-icon" viewBox="0 0 20 20">
                    <path fill="none" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
                </svg>
            </div>
            <div class="setting-menus">
                <div class="setting-menu">
                    <div class="setting-label" style="font-size: 30px">
                        对话设置
                    </div>
                    <div class="setting">
                        <div class="setting-label">
                            <div>对话名称</div>
                            <div class="setting-sub-label">
                                界面上显示的对话名称
                            </div>
                        </div>
                        <input type="text" id="chat-name" name="chat_name">
                    </div>

                    <div class="setting">
                        <div class="setting-label">
                            <div>助手指令</div>
                            <div class="setting-sub-label">
                                助手指令中必须包含<<>>，用于指定用户输入内容的所处位置
                            </div>
                        </div>
                        <input type="text" id="chat-assistant-prompt" name="chat_assistant_prompt">
                    </div>

                    <div class="setting">
                        <div class="setting-label">
                            <div>上下文数量</div>
                            <div class="setting-sub-label">
                                连续对话模式时，请求的上下文数量
                            </div>
                        </div>
                        <input type="number" id="chat-context-size" name="chat_context_size" min="1" max="20">
                    </div>

                    <div class="setting">
                        <div class="setting-label">
                            <div>聊天置顶序号</div>
                            <div class="setting-sub-label">
                                在聊天列表中置顶的序号，修改后将更新聊天列表
                            </div>
                        </div>
                        <input type="number" id="chat-sticky-number" name="chat-sticky-number" min="1">
                    </div>

                    <div class="setting">
                        <div class="label-svg-button">
                            <div class="setting-label">
                                <div>删除对话或聊天记录</div>
                                <div class="setting-sub-label">
                                    默认对话下将删除聊天记录，其他对话下将删除对话
                                </div>
                            </div>
                            <div id="del-chat-btn">
                                <svg class="svg-icon" viewBox="0 0 20 20">
                                    <path d="M17.114,3.923h-4.589V2.427c0-0.252-0.207-0.459-0.46-0.459H7.935c-0.252,0-0.459,0.207-0.459,0.459v1.496h-4.59c-0.252,0-0.459,0.205-0.459,0.459c0,0.252,0.207,0.459,0.459,0.459h1.51v12.732c0,0.252,0.207,0.459,0.459,0.459h10.29c0.254,0,0.459-0.207,0.459-0.459V4.841h1.511c0.252,0,0.459-0.207,0.459-0.459C17.573,4.127,17.366,3.923,17.114,3.923M8.394,2.886h3.214v0.918H8.394V2.886z M14.686,17.114H5.314V4.841h9.372V17.114z M12.525,7.306v7.344c0,0.252-0.207,0.459-0.46,0.459s-0.458-0.207-0.458-0.459V7.306c0-0.254,0.205-0.459,0.458-0.459S12.525,7.051,12.525,7.306M8.394,7.306v7.344c0,0.252-0.207,0.459-0.459,0.459s-0.459-0.207-0.459-0.459V7.306c0-0.254,0.207-0.459,0.459-0.459S8.394,7.051,8.394,7.306"></path>
                                </svg>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="left-container">
            <div class="chat-list">
                <div class="newchat" id="newchat">添加新的对话</div>

            </div>
        </div>
        <div class="right-container">
            <div class="head-area">
                <div class="head-left">
                    <div class="avatar">
                        <img src="/static/chatgpt.png" alt="">
                    </div>
                    <div class="head-info">
                        <div class="head-chat-name">默认对话</div>
                        <div class="head-chat-info">共0条记录</div>
                    </div>
                </div>
                <div class="head-right">
                    <div class="head-btns">
                        <a href="https://github.com/LiangYang666/ChatGPT-Web">
                            <div class="toggle-btn">
                                <svg class="svg-icon" viewBox="-2 -2 20 20">
                                    <!-- GitHub标志 -->
                                    <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
                                </svg>
                            </div>
                        </a>
                        <div class="toggle-btn" id="toggle-chats-btn">
                            <svg class="svg-icon" viewBox="0 0 20 20">
                                <path d="M10,1.445c-4.726,0-8.555,3.829-8.555,8.555c0,4.725,3.829,8.555,8.555,8.555c4.725,0,8.555-3.83,8.555-8.555C18.555,5.274,14.725,1.445,10,1.445 M10,17.654c-4.221,0-7.654-3.434-7.654-7.654c0-4.221,3.433-7.654,7.654-7.654c4.222,0,7.654,3.433,7.654,7.654C17.654,14.221,14.222,17.654,10,17.654 M14.39,10c0,0.248-0.203,0.45-0.45,0.45H6.06c-0.248,0-0.45-0.203-0.45-0.45s0.203-0.45,0.45-0.45h7.879C14.187,9.55,14.39,9.752,14.39,10 M14.39,12.702c0,0.247-0.203,0.449-0.45,0.449H6.06c-0.248,0-0.45-0.202-0.45-0.449c0-0.248,0.203-0.451,0.45-0.451h7.879C14.187,12.251,14.39,12.454,14.39,12.702 M14.39,7.298c0,0.248-0.203,0.45-0.45,0.45H6.06c-0.248,0-0.45-0.203-0.45-0.45s0.203-0.45,0.45-0.45h7.879C14.187,6.848,14.39,7.051,14.39,7.298"></path>
                            </svg>
                        </div>
                        <div class="toggle-btn" id="toggle-setting-btn">
                            <svg class="svg-icon" viewBox="0 0 20 20">
                                <path d="M17.498,11.697c-0.453-0.453-0.704-1.055-0.704-1.697c0-0.642,0.251-1.244,0.704-1.697c0.069-0.071,0.15-0.141,0.257-0.22c0.127-0.097,0.181-0.262,0.137-0.417c-0.164-0.558-0.388-1.093-0.662-1.597c-0.075-0.141-0.231-0.22-0.391-0.199c-0.13,0.02-0.238,0.027-0.336,0.027c-1.325,0-2.401-1.076-2.401-2.4c0-0.099,0.008-0.207,0.027-0.336c0.021-0.158-0.059-0.316-0.199-0.391c-0.503-0.274-1.039-0.498-1.597-0.662c-0.154-0.044-0.32,0.01-0.416,0.137c-0.079,0.106-0.148,0.188-0.22,0.257C11.244,2.956,10.643,3.207,10,3.207c-0.642,0-1.244-0.25-1.697-0.704c-0.071-0.069-0.141-0.15-0.22-0.257C7.987,2.119,7.821,2.065,7.667,2.109C7.109,2.275,6.571,2.497,6.07,2.771C5.929,2.846,5.85,3.004,5.871,3.162c0.02,0.129,0.027,0.237,0.027,0.336c0,1.325-1.076,2.4-2.401,2.4c-0.098,0-0.206-0.007-0.335-0.027C3.001,5.851,2.845,5.929,2.77,6.07C2.496,6.572,2.274,7.109,2.108,7.667c-0.044,0.154,0.01,0.32,0.137,0.417c0.106,0.079,0.187,0.148,0.256,0.22c0.938,0.936,0.938,2.458,0,3.394c-0.069,0.072-0.15,0.141-0.256,0.221c-0.127,0.096-0.181,0.262-0.137,0.416c0.166,0.557,0.388,1.096,0.662,1.596c0.075,0.143,0.231,0.221,0.392,0.199c0.129-0.02,0.237-0.027,0.335-0.027c1.325,0,2.401,1.076,2.401,2.402c0,0.098-0.007,0.205-0.027,0.334C5.85,16.996,5.929,17.154,6.07,17.23c0.501,0.273,1.04,0.496,1.597,0.66c0.154,0.047,0.32-0.008,0.417-0.137c0.079-0.105,0.148-0.186,0.22-0.256c0.454-0.453,1.055-0.703,1.697-0.703c0.643,0,1.244,0.25,1.697,0.703c0.071,0.07,0.141,0.15,0.22,0.256c0.073,0.098,0.188,0.152,0.307,0.152c0.036,0,0.073-0.004,0.109-0.016c0.558-0.164,1.096-0.387,1.597-0.66c0.141-0.076,0.22-0.234,0.199-0.393c-0.02-0.129-0.027-0.236-0.027-0.334c0-1.326,1.076-2.402,2.401-2.402c0.098,0,0.206,0.008,0.336,0.027c0.159,0.021,0.315-0.057,0.391-0.199c0.274-0.5,0.496-1.039,0.662-1.596c0.044-0.154-0.01-0.32-0.137-0.416C17.648,11.838,17.567,11.77,17.498,11.697 M16.671,13.334c-0.059-0.002-0.114-0.002-0.168-0.002c-1.749,0-3.173,1.422-3.173,3.172c0,0.053,0.002,0.109,0.004,0.166c-0.312,0.158-0.64,0.295-0.976,0.406c-0.039-0.045-0.077-0.086-0.115-0.123c-0.601-0.6-1.396-0.93-2.243-0.93s-1.643,0.33-2.243,0.93c-0.039,0.037-0.077,0.078-0.116,0.123c-0.336-0.111-0.664-0.248-0.976-0.406c0.002-0.057,0.004-0.113,0.004-0.166c0-1.75-1.423-3.172-3.172-3.172c-0.054,0-0.11,0-0.168,0.002c-0.158-0.312-0.293-0.639-0.405-0.975c0.044-0.039,0.085-0.078,0.124-0.115c1.236-1.236,1.236-3.25,0-4.486C3.009,7.719,2.969,7.68,2.924,7.642c0.112-0.336,0.247-0.664,0.405-0.976C3.387,6.668,3.443,6.67,3.497,6.67c1.75,0,3.172-1.423,3.172-3.172c0-0.054-0.002-0.11-0.004-0.168c0.312-0.158,0.64-0.293,0.976-0.405C7.68,2.969,7.719,3.01,7.757,3.048c0.6,0.6,1.396,0.93,2.243,0.93s1.643-0.33,2.243-0.93c0.038-0.039,0.076-0.079,0.115-0.123c0.336,0.112,0.663,0.247,0.976,0.405c-0.002,0.058-0.004,0.114-0.004,0.168c0,1.749,1.424,3.172,3.173,3.172c0.054,0,0.109-0.002,0.168-0.004c0.158,0.312,0.293,0.64,0.405,0.976c-0.045,0.038-0.086,0.077-0.124,0.116c-0.6,0.6-0.93,1.396-0.93,2.242c0,0.847,0.33,1.645,0.93,2.244c0.038,0.037,0.079,0.076,0.124,0.115C16.964,12.695,16.829,13.021,16.671,13.334 M10,5.417c-2.528,0-4.584,2.056-4.584,4.583c0,2.529,2.056,4.584,4.584,4.584s4.584-2.055,4.584-4.584C14.584,7.472,12.528,5.417,10,5.417 M10,13.812c-2.102,0-3.812-1.709-3.812-3.812c0-2.102,1.71-3.812,3.812-3.812c2.102,0,3.812,1.71,3.812,3.812C13.812,12.104,12.102,13.812,10,13.812"></path>
                            </svg>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content">
            </div>
            <div class="input-area">
                <textarea name="text" id="textarea"></textarea>
                <div class="button-area">
                    <button id="stop-btn" class="talk_sub" style="display: none">停止生成</button>
                    <button id="edit-chat-btn" class="talk_sub">编辑对话</button>
                    <button id="chmod-btn" class="talk_sub">当前为普通对话</button>
                    <button id="send-btn" class="talk_sub">发 送</button>
                </div>
            </div>
        </div>

    </div>
<!--  当移动到消息框时显示的复制按钮 默认不显示，由js控制显示 -->
    <div class="menu" id="menu">
        <button class="menu-btn" id="copy-btn">复制</button>
        <button class="menu-btn" id="resend-btn">重新发送</button>
    </div>


</body>
<script src="/static/js/uiDisplay.js"></script>
<script src="/static/js/messageFormat.js"></script>
<script src="/static/js/utils.js"></script>
<script src="/static/js/chatFunctions.js"></script>
<script src="/static/js/clickEventHandler.js"></script>
<script src="/static/js/loadInit.js"></script>
</html>
